//
//  BaseViewController.m
//  zeekol
//
//  Created by gaojiefeng on 2020/7/13.
//  Copyright © 2020 gaojiefeng. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()<UIGestureRecognizerDelegate>

@end
@implementation BaseViewController
-(void) dealloc{
    NSLog(@"%s",__FUNCTION__);
    NSLog(@"%@",self.class);
}

-(void)viewDidLoad{
    [super viewDidLoad];
    if([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]){
        [self setEdgesForExtendedLayout:UIRectEdgeNone];
    }
    
    self.navigationController.navigationBar.translucent = NO;
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.interactivePopGestureRecognizer.delegate = (id)(self);
    self.fd_interactivePopDisabled = NO;
    self.fd_prefersNavigationBarHidden = YES;
}

-(void) viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [[[UIApplication sharedApplication] delegate].window endEditing:YES];
}

-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
}

#pragma mark UIGestureRecognizerDelegate

-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{
    return YES;
}

-(UIStatusBarStyle) preferredStatusBarStyle{
    return UIStatusBarStyleLightContent;
}

-(BOOL)shouldAutorotate{
    return NO;
}
-(BOOL)prefersStatusBarHidden{
    return YES;
}

-(UIInterfaceOrientationMask )supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

-(UIInterfaceOrientation) preferredInterfaceOrientationForPresentation{
    return UIInterfaceOrientationLandscapeLeft;
}
@end
